<?

//pr($lang);

$templ_url = $Page->page_template_folder;
// pr("\$templ_url=$templ_url");

//global $lang;
// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


// <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 
// <html >
// <head>
// <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
/* // <link href="<?=PUBLIC_URL?>/css/base.css" rel="stylesheet" type="text/css" media="screen" /> */


require(PUBLIC_DIR.'/html/base_head.php');
?>


<title><?=$Page->title ?> - <?=$lang['general']['admin_center']?> <?=CMS_VERSION ?> 
</title>

<link href="<?=$templ_url?>/files/styleadmin.css" rel="stylesheet" type="text/css" media="screen" />

<script type="text/javascript" src="<?=$templ_url?>/files/script.js" ></script>
<script type="text/javascript" src="<?=$templ_url?>/files/admin.js" ></script>



<meta name="robots" content="noindex" />


<body>
<iframe name="saveform_iframe" style='display:none;'  >
</iframe>

<? //= "[".ReturnURL::$url ."]" ?>

<DIV id=footer_pusher >

<DIV class="toppanel"><iframe></iframe>
<div class="topmenu">

<TABLE width=100%><TR>
	
	
	<TD class=topmenu_title  > 
		<img src=<?=$templ_url?>/img/logo-cms.png style='padding:1px 10px 1px 10px; '>
	

<? if($User->is_admin) { ?>
	
	<TD class=topmenu_body > 
		
	
	<?
		$top_menu = Admin::get_pages('menu=top_menu');
		foreach ($top_menu as $pg) 
		{
			$pg = (object)$pg;
			?>
			<a class="menuitem" href="<?=$pg->url ?>" target="<?=val($pg->target)?>" >
				<span title="<?=val($pg->tooltip)?>"  >
				<img  alt="<?=val($pg->tooltip)?>" src="<?=val($pg->img) ?>" >&nbsp;<?=$pg->title ?>
				</span>
			</a>
		
	<?	} //end foreach ($top_menu as $pg) ?>
	
        
	
	<TD class=tray_td align=right>

		<div id="tray">
		<?
		$menu = Admin::get_pages('menu=tray');
		foreach ($menu as $pg) 
		{
			$pg = (object)$pg;
			?>
			<a href="<?=$pg->url ?>" target="<?=val($pg->target)?>" >
				<span title="<?=val($pg->tooltip)?>"  >
				<img  alt="<?=val($pg->tooltip)?>" src="<?=$pg->img ?>" >&nbsp;<?=$pg->title ?>
				</span>
			</a>
		
		<?}?>
		</div> 
	
<?} //end if($User->is_admin) 
	else {?>
	
	<td class="topmenu_login topmenu_body" nowrap >
	Вход в панель управления сайтом <?//=CMS_VERSION ?>
	
	
	<td class="topmenu_right tray" nowrap >
	<a href=/ class=small 
	title="Перейти на главную страницу сайта"
	><img src="/system/modules/site/admin_templates/images/viewsite-22.png" 
	style='margin-right:5px;'
	>На главную</a>
	
<?}?>	

	
</TABLE>
    
</div>


<? if(val($Page->toolbar_id) && $User->is_admin) {?>


	<div class=toolbar  >
	<TABLE width=100% ><TR>
	<TD class=toolbar_title nowrap width=270> 
	<nobr><?=$Page->title?></nobr>
	
	
<? 	
	// pr(Admin::$admin_pages);
$toolbar = Admin::get_pages('menu=toolbar_'.$Page->toolbar_id);

// pr($toolbar);
	
if ($toolbar)
{ ?>
	<TD class=toolbar_body width2=100% >
		<?
		
		// pr($toolbar);
		$count = count($toolbar);
		foreach ($toolbar as $page)
		{
			$page->target = val($page->target);
			
			echo 
			"<a href='{$page->url}' id=link_{$page->id} title='{$page->tooltip}' "
			.(Core::$Page->action->url==$page->url && !isset($page->is_disable) ? ' class=active ':'')
			.(!empty($page->is_disable) ? ' class=disable ':'' )
			.(!empty($page->onclick) ? " onclick='{$page->onclick}' ":'' )
			." target='$page->target' "
			.' >'
			.(!empty($page->img)? "<span class=img><img width=22 heigh=22 align=middle src='{$page->img}'></span>":"")
			.$page->title
			."</a>"
			.(--$count >0 ? ' | ' : '');
		
		} //end foreach ($toolbar as $page)
} // end if ($toolbar)
?>
	</TABLE>
	</div>
	<DIV class=toolbar_bottom></DIV>

<?} //end if($Page->toolbar_id) ?>

</DIV>
<NOSCRIPT><DIV style="FONT-SIZE: 15px; COLOR: red; text-align:center; margin:3px;">У вас отключены скрипты JavaScript. Для правильной работы админки необходимо включить их</DIV></NOSCRIPT>



<div id="content" >


 
<?//="<h1>{$Page->title}</h1>" ?>


<?=$Page->content?>


</div>

<div id="footer_push"></div>
</DIV> <!--end <DIV id=footer_pusher> -->

<div id="footer">
<div id="footer_copyright">

&nbsp;© 2009-2010 <A href="http://www.sitecomfort.org" 
target=_blank><?=CMS_VERSION ?></A> – предоставляется на правах лицензии GNU General Public License

</div>
</div>

</body>
</html>
